using System.Text;

namespace org.lionsoul.ip2region
{

    /// <summary>
    /// data block class
    /// 
    /// @author    chenxin<chenxin619315@gmail.com>
    /// </summary>
    public class DataBlock
    {
        /// <summary>
        /// city id 
        /// </summary>
        private int city_id;

        /// <summary>
        /// region address
        /// </summary>
        private string region;

        public DataBlock(int city_id, string region)
        {
            this.city_id = city_id;
            this.region = region;
        }

        public virtual int CityId
        {
            get
            {
                return city_id;
            }
        }

        public virtual DataBlock setCityId(int city_id)
        {
            this.city_id = city_id;
            return this;
        }

        public virtual string Region
        {
            get
            {
                return region;
            }
        }

        public virtual DataBlock setRegion(string region)
        {
            this.region = region;
            return this;
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(city_id).Append('|').Append(region);
            return sb.ToString();
        }
    }
}